int lhdfs_open(struct lhdfs_ctrl *fs_ctrl, int flag)
{
	/* Check the arguments of lhdfs_open */
	if (NULL == fs_ctrl) {
		printf("Bad argument of fs_ctrl!\n You may not init the fs_ctrl!\n");
		return -1;
	}
	if (O_RDONLY != flag || O_RDWR != flag ) {
		printf("Bad argument of flag!\n");
		return -1;
	}

	/* Get the only inode number existing in our filesystem */
	int ino;
	bool is_exist = is_inode_exist(fs_ctrl->lfs_im);
	if (is_exist == false && !is_need_creat(flag)) {
		printf("The file is not existing!\n");
		return -1;
	}
	if (is_exist == true && is_need_creat(flag)) {
		printf("Can't creat the file for it has already existed!\n");
		return -1;
	}

	struct lhdfs_inode *inode;
	if (is_exist == flase && is_need_creat(flag)) {  /* need to creat new file */
		creat_file("xiyoulinux");
		update_inode_creat_timestamp(fs_ctrl->inode);
		update_inode_access_timestamp(inode);	/*here how to update*/
		ino = get_inode_no(fs_ctrl->lfs_im);
	}
	if (is_exist == true && !is_need_creat(flag)) {
		load_inode(fs_ctrl->inode, fs_ctrl->lfs_im.lfs_id);
		update_inode_access_timestamp(inode);
		ino = get_inode_no(fs_ctrl->lfs_im);
	}

	write_to_log(fs_ctrl, NULL, -1, -1);
	

	return ino;
}
